import http from './http'

/**
 * 生产工单相关API
 */
export const productionWorkOrdersApi = {
  /**
   * 分页查询生产工单
   * 对应后端：GET /productionWorkOrders/page
   */
  getPage(params) {
    return http.get('/produce/productionWorkOrders/page', { params })
  },

  /**
   * 新增生产工单
   * 对应后端：POST /productionWorkOrders/add
   */
  add(data) {
    return http.post('/produce/productionWorkOrders/add', data)
  },

  /**
   * 更新生产工单
   * 对应后端：PUT /productionWorkOrders/update
   */
  update(data) {
    return http.put('/produce/productionWorkOrders/update', data)
  },

  /**
   * 删除生产工单
   * 对应后端：DELETE /productionWorkOrders/delete/{id}
   */
  remove(id) {
    return http.delete(`/produce/productionWorkOrders/delete/${id}`)
  },

  /**
   * 查询工单详情
   * 对应后端：GET /productionWorkOrders/detail/{id}
   */
  getDetail(id) {
    return http.get(`/produce/productionWorkOrders/detail/${id}`)
  },
}

export default productionWorkOrdersApi
